package com.learn.yu.proxy.statical;

/**
 * @author : Yu.Tan
 * @date : 2023/6/21 16:23
 * @desc : **
 */
public class Proxy extends Subject{

    private RealSubject realSubject;

    @Override
    public void request() {
        if (realSubject==null){
            realSubject=new RealSubject();
        }
        System.out.println("代理前执行");
        realSubject.request();
        System.out.println("代理后执行");
    }
}
